﻿using Project.Frame.Net.Application.Models.Response;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Frame.Net.Application.Ex
{
    // 领域层/Exceptions/DomainException.cs
    public class ServiceException : Exception
    {
        public CodeEnums Code { get; } // 业务错误码
        public ServiceException(CodeEnums code, string message) : base(message) => Code = code;
    }

    // 特定领域异常示例
    public class UserNotFoundException : ServiceException
    {
        public UserNotFoundException() : base(CodeEnums.其他, "用户不存在") { }
    }

}
